/*
 * @Title: 姿美汇拼团外部分享
 * @Author: zhj
 * @Date:   2018-10-24
 * @Last Modified by:   zhj
 * @Last Modified time: 2018-10-24
 */
var dataInfo = new Object(),
  flag = true,
  template = {
    init: function() {
      Vue.use(VueLazyload, {
        preLoad: 1.3,
        error: 'https://h5.meetao.com/img/product/init.png',
        loading: 'https://h5.meetao.com/img/product/init.png',
        attempt: 1
      });
      dataInfo.init = new Vue({
        el: '#app',
        data: {
          pageNo: 1, //页数
          pageSize: 20, //数据条数
          loading: false, //加载开光
          finished: false,
          ChooceSaveType: 0, //默认加入购物车保存
          warringInfo: '',
          ajaxData: {}, //接口参数
          bottowPopup: { //底部弹框
            cartShow: false, //规格选择
            show: false, //保障说明
            loginShow: false //登录弹框
          },
          specificationData: { //购物车规格
            inventory: "",
            specificationList: [],
            secondActive: 100,
            specificationDetail: {}, //规格详情
            num: 1, //数量
            goodsCode: "",
            id: ""
          },
          getCodeInfo: '获取验证码',
          warringInfo: '',
          phone: "", //手机号
          code: "", //验证码
          codeNum: 1, //发送短信按钮点击开关
          isYY: 1, //是否发送语音验证码
          statusSwitch: 1,
          shareProductInfo: [], //分享后产品详情
          actorUserInfo: [], //参团用户信息
          notHeader: [], //未参团头像
          fullPrice: "", //满减后的价钱
          inProgress: [], //他们也在拼单列表
          GroupList: [], //火热拼列表
          ActorNum: "", //还需拼团人数
          GroupType: "", //拼团类型
          type: "", //拼团类型type值
          grouponStatus: "", //拼团状态
          more: false, //查看更多显示
          isJoin: '', //是否是参团 ‘T’ 是 ‘F’否
          isXiangou: "", //是否限购
          isPtSuccess: "",
          day: "", //倒计时-天
          hr: "", //倒计时-小时
          min: "", //倒计时-分钟
          sec: "", //倒计时-秒
          openId: !getQueryString('openid') ? openId : getQueryString('openid'),
          isWx: is_weixn(),
        },
        methods: {
          init: function() {
            dataInfo.init.sharegetgroupinfo();
            dataInfo.init.formatDuring();
            dataInfo.init.GroupType = getQueryString("GroupType");
            dataInfo.init.countdown();
            GroupType = dataInfo.init.GroupType;
						virtualgoodsID=getQueryString('virtualgoodsID');
						activityId=getQueryString('activityId');
						groupId=getQueryString('groupId');
          },
          onLoad: function() {
            this.gethotgrouplist();
          },
          toCoupon: function(num) { //保障说明
            dataInfo.init.bottowPopup.show = !dataInfo.init.bottowPopup.show;
          },
          Onjoin: function(tg, isjoins) { //参团登录框
            if (!!access_token) {
              ajaxTemplate(addressTest + SERVICE.Verification, function(data) {
                var isjoin = data.data.result;
                if (data.tag == 0) {
                  if (isjoin.isJoin == 0) {
                    dataInfo.init.$toast(isjoin.reason);
                    dataInfo.init.isJoin = "F";
                  } else {
                    if (tg) {
                      dataInfo.init.isJoin = "T";
                      dataInfo.init.specificationChooce(true, 1, dataInfo.init.isJoin);
                    }
                  };
                } else {
                  dataInfo.init.$toast(data.errMsg);
                }
              }, {
                userid: userId,
                activityId: dataInfo.init.shareProductInfo.activityId,
                isJoinGroup: isjoins

              });
            } else {
              //							dataInfo.init.bottowPopup.loginShow = !dataInfo.init.bottowPopup.loginShow;
              jumpLogin();
            }
          },
          OnPtIndex: function() {
            window.location.href = "PtIndex.html?grouponType=common_pt_groupon";
          },
          direct: function() { //直接拼
            dataInfo.init.specificationChooce(true, 1, "T");
          },
          specificationChooce: function(tg, type, isJoin) { //规格选择
            dataInfo.init.isJoin = isJoin;
            dataInfo.init.ChooceSaveType = type;
            dataInfo.init.specificationData.secondActive = 100;
            if (!!access_token) {
              ajaxTemplate(addressTest + SERVICE.PTgetsubPDinfo, function(data) {
                if (data.tag == 0) {
                  if (tg) {
                    dataInfo.init.bottowPopup.cartShow = !dataInfo.init.bottowPopup.cartShow;
                  }
                  dataInfo.init.specificationData.specificationList = data.data.result.goodlist;
                  //dataInfo.init.specificationData.inventory = data.data.result.stock;
                  dataInfo.init.specificationData.num = 1;
                  dataInfo.init.specificationData.specificationDetail.imgUrl = dataInfo.init.imgUrl;
                  dataInfo.init.specificationData.specificationDetail.activityPrice = data.data.result.priceRange;
                  dataInfo.init.specificationData.specificationDetail.oldPrice = data.data.result.oldPrice;
                  dataInfo.init.specificationData.specificationDetail.specifications = "请选择规格";
                  if (dataInfo.init.specificationData.specificationList.length == 1 && dataInfo.init.specificationData.specificationList[0].activityInventory != 0) {
                    dataInfo.init.specificationData.secondActive = 0;
                    dataInfo.init.specificationData.goodsCode = dataInfo.init.specificationData.specificationList[0].goodsCode;
                    dataInfo.init.specificationData.specificationDetail = dataInfo.init.specificationData.specificationList[0];
                    dataInfo.init.specificationData.inventory = dataInfo.init.specificationData.specificationList[0].activityInventory;
                    if (dataInfo.init.specificationData.specificationList[0].islimitOne == 1) {
                      dataInfo.init.isXiangou = true;
                      dataInfo.init.specificationData.num = 1;
                    } else {
                      dataInfo.init.isXiangou = false;
                    }
                  } else {
                    if (dataInfo.init.specificationData.specificationList[0].activityInventory != 0) {
                      dataInfo.init.specificationData.secondActive = 0;
                      dataInfo.init.specificationData.inventory = dataInfo.init.specificationData.specificationList[0].activityInventory;
                      if (dataInfo.init.specificationData.specificationList[0].islimitOne == 1) {
                        dataInfo.init.isXiangou = true;
                        dataInfo.init.specificationData.num = 1;
                      } else {
                        dataInfo.init.isXiangou = false;
                      }
                    } else {
                      dataInfo.init.specificationData.inventory = 0;
                      dataInfo.init.isXiangou = false;
                    }
                    dataInfo.init.specificationData.goodsCode = dataInfo.init.specificationData.specificationList[0].goodsCode;
                    dataInfo.init.specificationData.specificationDetail = dataInfo.init.specificationData.specificationList[0];
                  }

                } else {
                  dataInfo.init.$toast(data.errMsg);
                }
              }, {
                virtualgoodsID: getQueryString("virtualgoodsID"),
                activityId: getQueryString("activityId")
              });

            } else {
              //							dataInfo.init.bottowPopup.loginShow = !dataInfo.init.bottowPopup.loginShow;
              jumpLogin();
            }
          },
          specificationDetailC: function(index) { //规格详情点击
            dataInfo.init.specificationData.secondActive = index;
            if (dataInfo.init.specificationData.specificationList[index].islimitOne == 1) {
              dataInfo.init.isXiangou = true;
              dataInfo.init.specificationData.num = 1;
            } else {
              dataInfo.init.isXiangou = false;
            }
            dataInfo.init.specificationData.specificationDetail = dataInfo.init.specificationData.specificationList[index];
            dataInfo.init.specificationData.id = dataInfo.init.specificationData.specificationList[index].id;
            dataInfo.init.specificationData.goodsCode = dataInfo.init.specificationData.specificationList[index].goodsCode;
            if (dataInfo.init.specificationData.specificationList[index].activityInventory == 0) {
              dataInfo.init.specificationData.inventory = 0;
            } else {
              dataInfo.init.specificationData.inventory = dataInfo.init.specificationData.specificationList[index].activityInventory;
            }
          },
          specificationChooceSave: function() { //规格选择确定
            if (flag) {
              if (dataInfo.init.specificationData.specificationList.length != 1 && dataInfo.init.specificationData.secondActive == 100) {
                this.$toast('请选择规格');
              } else {
                if (dataInfo.init.specificationData.inventory != 0) {
                  flag = false;
                  //立即购买
                  var goodsInfo = {
                    num: dataInfo.init.specificationData.num,
                    goodsCode: dataInfo.init.specificationData.goodsCode,
                    isKill: 1,
                  };
                  var result = JSON.stringify(goodsInfo);

                  setTimeout(function() {
                    if (dataInfo.init.isJoin == "F") {
                      window.location.href = "orderFilling.html?orderData=" + result + "&grouponGoodsVirtualId=" + dataInfo.init.shareProductInfo.grouponGoodsVirtualId + "&activityId=" + getQueryString("activityId") + "&isJoin=" + dataInfo.init.isJoin + "&grouponGoodsItemId=" + dataInfo.init.shareProductInfo.grouponGoodsItemId;
                    } else {
                      window.location.href = "orderFilling.html?orderData=" + result + "&grouponGoodsVirtualId=" + dataInfo.init.shareProductInfo.grouponGoodsVirtualId + "&activityId=" + getQueryString("activityId") + "&isJoin=" + dataInfo.init.isJoin + "&grouponGoodsItemId=" + dataInfo.init.shareProductInfo.grouponGoodsItemId + "&groupId=" + getQueryString("groupId");
                    }
                  }, 500);
                } else {
                  dataInfo.init.$toast("商品库存不足");
                }
              }

            } else {
              dataInfo.init.$toast("重复点击");
            }
          },
          Onrule: function() { //规则跳转
            if (dataInfo.init.GroupType == "common_pt_groupon") {
              dataInfo.init.type = "2";
            } else if (dataInfo.init.GroupType == "new_guest_pt_groupon") {
              dataInfo.init.type = "1";
            } else if (dataInfo.init.GroupType == "colonel_free_pt_groupon") {
              dataInfo.init.type = "3";
            }
            location.href = "../html/PtRule.html?type=" + dataInfo.init.type;
          },
          submit: function() { //外部分享登录
            if (!!this.active && this.statusSwitch == 1) {
              this.statusSwitch = 2;
              ajaxTemplate(addressCodeUrl + SERVICE.fxH5Login, function(data) {
                if (data.tag == 0) {
                  dataInfo.submitData = data.data.result.data;
                  !!dataInfo.init.isWx ? dataInfo.submitData.openId = dataInfo.init.openId : '';
                  setCookie('zmtH5Mall', escape(JSON.stringify(dataInfo.submitData)), 30);
                  dataInfo.init.detectionJump();
                } else {
                  dataInfo.init.statusSwitch = 1;
                  dataInfo.init.warringInfo = data.errMsg;
                };
              }, {
                phone: dataInfo.init.phone,
                verifyCode: dataInfo.init.code,
                type: 1,
                openId: this.openId,
                shopCode: shareShopCode
              });
            };
          },
          getCode: function() { //获取短信验证码
            dataInfo.init.warringInfo = '';
            if (dataInfo.init.codeNum == 1) { //发送短信 - start
              if (!(/^1[0-9]\d{9}$/.test(this.phone))) {
                this.warringInfo = '请输入正确手机号';
              } else {
                this.codeNum == 2;
                dataInfo.init.getCodeInfo = '发送中..';
                dataInfo.init.getCoding();
              };
            }; //发送短信 - end
          },
          getYYCode: function() { //获取语音验证码
            this.warringInfo = '';
            if (this.codeNum == 2) {
              this.$dialog.alert({
                title: '正在获取短信验证码，请稍后'
              });
            } else if (!(/^1[0-9]\d{9}$/.test(this.phone))) {
              this.warringInfo = '请输入正确手机号';
            } else {
              dataInfo.init.$dialog.confirm({
                title: '确认接听语音验证码'
              }).then(function() {
                dataInfo.init.codeNum == 2;
                dataInfo.init.isYY = 0;
                dataInfo.init.getCoding();
              });
            };
          },
          getCoding: function() { //  dataInfo.init.getCoding();
            dataInfo.timestamp = new Date().getTime().toString();
            dataInfo.phone = '';
            dataInfo.init.phone.split('').forEach(function(item, index) {
              index == 0 || index == 2 || index == 4 || index == 6 || index == 8 ? dataInfo.phone += item : '';
            });
            dataInfo.phoneNum = hex_md5(hex_md5(dataInfo.init.phone.toString()) + (dataInfo.phone + dataInfo.timestamp).toString());
            ajaxTemplate(addressCodeUrl + SERVICE.fxCode, function(data) {
              if (data.tag == 0) {
                dataInfo.dataTime = 60;
                dataInfo.times = setInterval(function() {
                  if (dataInfo.dataTime <= 1) {
                    dataInfo.init.getCodeInfo = '重新发送';
                    $(".getCode").addClass("code_active");
                    dataInfo.times = window.clearInterval(dataInfo.times);
                    dataInfo.init.codeNum = 1;
                  } else {
                    dataInfo.init.codeNum = 2;
                    $(".getCode").removeClass("code_active");
                    dataInfo.init.getCodeInfo = --dataInfo.dataTime + 's';
                  }
                }, 1000);
              } else {
                dataInfo.init.codeNum = 1;
                dataInfo.init.getCodeInfo = '重新发送';
                dataInfo.init.warringInfo = data.errMsg;
              };
            }, {
              phone: dataInfo.init.phone,
              code: dataInfo.timestamp,
              sign: dataInfo.phoneNum,
              msgType: 'H5FXDLYZM',
              isYY: dataInfo.init.isYY
            });
          },
          detectionJump: function() { //刷新当前页
            location.reload();
          },
          sharegetgroupinfo: function() { //分享后进入获取拼团详情
            if (getQueryString('isApp') == 1) {
              dataInfo.init.ajaxData.m_ = getQueryString('m_');
              dataInfo.init.ajaxData.v_ = getQueryString('v_');
              dataInfo.init.ajaxData.pt_ = getQueryString('pt_');
              dataInfo.init.ajaxData.uid_ = getQueryString('uid_');
              dataInfo.init.ajaxData.access_token = getQueryString('access_token');
            } else {
              dataInfo.init.ajaxData.m_ = 'h5';
              dataInfo.init.ajaxData.v_ = '1.0';
              !dataInfo.init.ajaxData.pt_ ? dataInfo.init.ajaxData.pt_ = 'fxh5c' : '';
              dataInfo.init.ajaxData.uid_ = userId;
              !!access_token ? dataInfo.init.ajaxData.access_token = access_token : '';
            };
            dataInfo.init.ajaxData.groupId = getQueryString("groupId");
            $.ajax({
              url: addressTest + SERVICE.sharegetgroupinfo,
              type: 'post',
              dataType: 'jsonp',
              jsonp: 'callback',
              async: false,
              data: dataInfo.init.ajaxData,
              success: function(data) {
                var ProductInfo = data.data.result;
                if (data.tag == 0) {
                  console.log(data);
                  dataInfo.init.shareProductInfo = ProductInfo.PDinfo["0"];
                  dataInfo.init.grouponStatus = ProductInfo.PDinfo["0"].grouponStatus;
                  dataInfo.init.isPtSuccess = dataInfo.init.shareProductInfo.limitActorNum - dataInfo.init.shareProductInfo.realActorNum;
                  dataInfo.init.fullPrice = ((dataInfo.init.shareProductInfo.oldPrice) * 1000000 - (dataInfo.init.shareProductInfo.activityPrice) * 1000000) / 1000000;

                  fullPrice = dataInfo.init.fullPrice; //拼团分享产品满减金额 」
                  goodsName = dataInfo.init.shareProductInfo.virtualGoodsName; //拼团分享产品名称
                  isPtSuccess = dataInfo.init.isPtSuccess; // 拼团分享还需参团人数
                  sellingPointsDesc = dataInfo.init.shareProductInfo.virtualSellingPointsDesc; //拼团分享产品描述
                  imgUrl = dataInfo.init.shareProductInfo.virtualGoodsImg; //拼团分享产品图片

                  dataInfo.init.ActorNum = ProductInfo.PDinfo["0"].limitActorNum - ProductInfo.PDinfo["0"].realActorNum;
                  dataInfo.init.join_people();
                  dataInfo.init.headerImgs();
                  if (data.data.result.PDinfo["0"].actorUserInfo == undefined) { //参团人员信息
                    dataInfo.init.actorUserInfo = [];
                  } else {
                    dataInfo.init.actorUserInfo = JSON.parse(data.data.result.PDinfo["0"].actorUserInfo);
                  }
                  if (dataInfo.init.grouponStatus != 1) { //判断拼团成功后未参团头像展示
                    for (var i = 0; i < dataInfo.init.isPtSuccess; i++) {
                      dataInfo.init.notHeader[i] = i;
                    }
                  } else {
                    dataInfo.init.notHeader = [];
                  }
                  if (dataInfo.init.shareProductInfo.starterHeadImageUrl == "") {
                    dataInfo.init.shareProductInfo.starterHeadImageUrl = "../img/PtPaySuccess/default-header.png";
                  };
                  for (var i = 0; i < dataInfo.init.actorUserInfo.length; i++) {
                    if (dataInfo.init.actorUserInfo[i].headImageUrl == "") {
                      dataInfo.init.actorUserInfo[i].headImageUrl = "../img/PtPaySuccess/default-header.png";
                    }
                  };
                }
              },
              error: function(e) {
                //								dataInfo.init.bottowPopup.loginShow = !dataInfo.init.bottowPopup.loginShow;
                jumpLogin();
              }
            });
          },
          gethotgrouplist: function() { //获取火热拼列表
            ajaxTemplate(addressTest + SERVICE.gethotgrouplist, function(data) {
              if (data.tag == 0) {
                dataInfo.init.GroupList = JSON.parse(JSON.stringify(dataInfo.init.GroupList.concat(data.data.result)));
                if (data.data.result.length < dataInfo.init.pageSize) {
                  dataInfo.init.finished = true;
                } else {
                  dataInfo.init.finished = false;
                }
                dataInfo.init.loading = false;
              } else {
                dataInfo.init.$toast(data.errMsg);
              }

            }, {
              pageNo: dataInfo.init.pageNo++,
              pageSize: dataInfo.init.pageSize
            });
          },
          headerImgs: function() { //拼团头像显示更多
            if (dataInfo.init.shareProductInfo.limitActorNum > 5) {
              dataInfo.init.more = true;
              $(".headerImg_list").addClass("headerImg_left");
            } else {
              dataInfo.init.more = false;
            }
          },
          lookmore: function() { //查看更多
            if (dataInfo.init.shareProductInfo.limitActorNum > 15) {
              $(".headerImg_list").addClass("headerImg_show");
            } else {
              $(".headerImg_list").css("height", "auto");
            }
            $(".moreBox").hide();
            $(".takeBox").show();
          },
          TakeUp: function() { //收起
            $(".headerImg_list").scrollTop(0);
            $(".headerImg_list").removeClass("headerImg_show");
            $(".headerImg_list").css("height", "");
            $(".moreBox").show();
            $(".takeBox").hide();
          },
          LaunchPt: function(productId, activityId, isjoins) { //发起新团
            ajaxTemplate(addressTest + SERVICE.Verification, function(data) {
              var isjoin = data.data.result;
              if (data.tag == 0) {
                if (isjoin == 0) {
                  dataInfo.init.$toast(isjoin.reason);
                } else {
                  location.href = "../html/PtProductDetails.html?productId=" + productId + "&activityId=" + activityId;
                }
              } else {
                dataInfo.init.$toast(data.errMsg);
              }
            }, {
              userid: userId,
              activityId: activityId,
              isJoinGroup: isjoins
            });
          },
          countdown: function() { //他们也在拼倒计时
            if (dataInfo.init.inProgress.length > 0) {
              var timer = setInterval(function() {
                for (var i = 0; i < dataInfo.init.inProgress.length; i++) {
                  var remainTime = dataInfo.init.inProgress[i].endTime - Date.parse(new Date());
                  dataInfo.init.inProgress[i].remainTime = remainTime;
                  var t = dataInfo.init.inProgress[i].remainTime;
                  if (t > 0) {
                    var day = Math.floor(t / 86400000);
                    var hour = Math.floor((t / 3600000) % 24);
                    var min = Math.floor((t / 60000) % 60);
                    var sec = Math.floor((t / 1000) % 60);
                    day = day < 10 ? '0' + day : day;
                    hour = hour < 10 ? '0' + hour : hour;
                    min = min < 10 ? '0' + min : min;
                    sec = sec < 10 ? '0' + sec : sec;
                    var format = '';
                    format = hour + ":" + min + ":" + sec;
                    dataInfo.init.inProgress[i].remainTimeStr = format;

                    $("#time" + i).html(dataInfo.init.inProgress[i].remainTimeStr);
                  } else {
                    // 进行判断 如果数据内所有的倒计时已经结束，那么结束定时器， 如果没有那么继续执行定时器
                    var flag = dataInfo.init.inProgress.every(function(val, ind) {
                      val.remainTime <= 0
                    });
                    if (flag) clearInterval(timer);
                    dataInfo.init.inProgress[i].remainTimeStr = "00:00:00";
                    $("#time" + i).html("00:00:00");
                  };
                };
              }, 1000);
            };
          },
          timeFormat: function(param) { //小于10的格式化函数
            return param < 10 ? '0' + param : param;
          },
          formatDuring: function() { //倒计时
            // 获取当前时间，同时得到活动结束时间数组
            var newTime = new Date().getTime();
            var endTime = dataInfo.init.shareProductInfo.endTime; //结束时间dataInfo.init.PDinfo["0"].endTime
            var obj = null;
            if (endTime - newTime > 0) {
              var time = (endTime - newTime) / 1000;
              // 获取天、时、分、秒
              dataInfo.init.day = parseInt(time / (60 * 60 * 24));
              dataInfo.init.hr = parseInt(time % (60 * 60 * 24) / 3600);
              dataInfo.init.min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
              dataInfo.init.sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
              dataInfo.init.day = dataInfo.init.timeFormat(dataInfo.init.day);
              dataInfo.init.min = dataInfo.init.timeFormat(dataInfo.init.min);
              dataInfo.init.sec = dataInfo.init.timeFormat(dataInfo.init.sec);
              if (dataInfo.init.day != 0) {
                dataInfo.init.hr = dataInfo.init.timeFormat(dataInfo.init.hr + dataInfo.init.day * 24);
              } else {
                dataInfo.init.hr = dataInfo.init.timeFormat(dataInfo.init.hr);
              }
            } else { //活动已结束，全部设置为'00'
              dataInfo.init.day = "00",
                dataInfo.init.hr = "00",
                dataInfo.init.min = "00",
                dataInfo.init.sec = "00";
            };
            setTimeout(dataInfo.init.formatDuring, 1000);
          },
          join_people: function() { //参与人数截取位数
            if (dataInfo.init.GroupList != "") {
              if (dataInfo.init.GroupList.length > 0) {
                for (var i = 0; i < dataInfo.init.GroupList.length; i++) {
                  if (dataInfo.init.GroupList[i].showActorNum >= 10000) {
                    dataInfo.init.GroupList[i].showActorNum = (dataInfo.init.GroupList[i].showActorNum / 10000).toFixed(1) + "万";
                  }
                }
              };
            }
            if (dataInfo.init.shareProductInfo.showActorNum >= 10000) {
              dataInfo.init.shareProductInfo.showActorNum = (dataInfo.init.shareProductInfo.showActorNum / 10000).toFixed(1) + "万";
            }
          },
          getOpenId: function() { //openid获取
            if (!this.openId && !!this.isWx) { //无openId
              dataInfo.wxJumpInfo = window.location.href.split('/html/PtShare.html?groupId=');
              dataInfo.wxJumpUrl = dataInfo.wxJumpInfo[0] + '/html/PtShare.html?groupId=' + escape(dataInfo.wxJumpInfo[1]);
              setCookie('zmtH5PtShare', window.location.href.split('/html/PtShare.html?')[1], 30);
              location.href = "http://www.fulibailing.top/service/silence/auth?appid=wx004631167cb38682&redirect_url=" + escape(window.location.href) + "&flag=44654454545151515132fdsfdf";
            } else if (!!this.openId && !getQueryString('virtualgoodsID')) { //授权成功回调无virtualgoodsID
              //此处可以改为不跳转 从字符串截取 或者存储为对象形式 后续带优化  181127 jsl
              location.href = window.location.href.split('/html/PtShare.html?')[0] + '/html/PtShare.html?openId=' + this.openId + '&' + getCookie('zmtH5PtShare');
            };
          },
        },
        computed: {
          active: function() {
            return !!/^1[0-9]\d{9}$/.test(this.phone) && this.code.length == 6;
          },
          code_active: function() {
            return !!/^1[0-9]\d{9}$/.test(this.phone);
          }
        },
      });
      if (!!userId) {
        dataInfo.init.init();
      } else {
        jumpLogin();
      }
      //			dataInfo.init.getOpenId();    //
    }
  };
template.init();
